package util;

import com.fasterxml.jackson.databind.ObjectMapper;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class TipsUtil {
    public static void tips(HttpServletRequest req, HttpServletResponse resp, Object message) {
        resp.setContentType("text/html;charset=utf-8");
        try {
            req.setCharacterEncoding("UTF-8");
            ObjectMapper mapper = new ObjectMapper();
            mapper.writeValue(resp.getWriter(), message);
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}
